package com.cloud.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cloud.bean.Product;
import com.cloud.mapper.ProductMapper;
import com.cloud.service.ProductService;

@Service
public class ProductServiceImpl implements ProductService{

	@Autowired
	ProductMapper productMapper;
	
	@Override
	public List<Product> selectAll() {
		return productMapper.selectAll();
	}

	@Override
	public Product selectById(int id) {
		return productMapper.selectById(id);
	}

	@Override
	public void insertProduct(Product product,ProductService productService) {
		productMapper.insertProduct(product);
		productService.deleteById(63);
	}

	@Override
	public void updateProductById(Product product) {
		productMapper.updateProductById(product);
	}

	@Override
	public void deleteById(int id) {
		productMapper.deleteById(id);
		
	}

}
